package com.itheima.thread.api.demo06;

public class ThreadDemo01 {

    public static void main(String[] args) {

        for(int x = 0; x < 50; x++) {

            if(x == 20) {

                MyThread t1 = new MyThread();
                t1.setName("刘亦菲");
                t1.start();

                try {
                    t1.join();
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }

            }

            System.out.println(Thread.currentThread().getName() + "----" + x);

        }

    }

}
